﻿<Window x:Class="Sudoku.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:viewModels="clr-namespace:Sudoku.ViewModels"
        xmlns:controls="clr-namespace:Sudoku.Controls"
        Title="Sudoku" Height="570" Width="585" MinHeight="570" MinWidth="385" ShowInTaskbar="False"
        WindowStartupLocation="CenterScreen" WindowState="Maximized"
        VisualTextHintingMode="Animated" UseLayoutRounding="True" SnapsToDevicePixels="True"
        AllowsTransparency="False" Background="Brown" Opacity="{Binding Path=Opacity}" WindowStyle="None">
  <!--ResizeMode="CanResize" WindowStyle="None" WindowState="Maximized" WindowStartupLocation="CenterScreen" Topmost="True" -->
  <!--AllowsTransparency="True" Background="Brown" Opacity="{Binding Path=Opacity}"-->
  <Window.Resources>
    <Style TargetType="{x:Type TextBox}">
      <Style.Triggers>
        <Trigger Property="Validation.HasError" Value="true">
          <Setter Property="ToolTip" Value="{Binding RelativeSource={x:Static RelativeSource.Self}, Path=(Validation.Errors)[0].ErrorContent}" />
          <!--<Setter TargetName="NotificationArea" Property="Text"
                  Value="Test" />-->
        </Trigger>
      </Style.Triggers>
    </Style>
  </Window.Resources>
  <!--<Window.DataContext>B
    <viewModels:MainViewModel />
  </Window.DataContext>-->
  <Grid>
    <Grid.RowDefinitions>
      <RowDefinition Height="*" MinHeight="50" MaxHeight="80"></RowDefinition>
      <RowDefinition Height="5"></RowDefinition>
      <RowDefinition Height="5*"></RowDefinition>
      <RowDefinition Height="5"></RowDefinition>
      <RowDefinition Height="*" MinHeight="50" MaxHeight="80"></RowDefinition>
    </Grid.RowDefinitions>
    <Grid Background="FloralWhite" Grid.Row="0">
      <Grid.ColumnDefinitions>
        <ColumnDefinition Width="125"></ColumnDefinition>
        <ColumnDefinition Width="*"></ColumnDefinition>
        <ColumnDefinition Width="*"></ColumnDefinition>
      </Grid.ColumnDefinitions>

      <Button HorizontalAlignment="Left" VerticalAlignment="Center" 
              MinWidth="20" MinHeight="25" MaxHeight="45" Width="105" Padding="0" Margin="10,2,5,2"
              Content="Give me a _Hint!" Background="BlanchedAlmond" BorderBrush="Blue" ClickMode="Press"
              Command="{Binding Path=GiveMeHint}"></Button>

      <Button HorizontalAlignment="Left" VerticalAlignment="Center" Grid.Column="1"
              MinWidth="20" MinHeight="25" MaxHeight="45" Width="50" Padding="0" Margin="10,2,5,2"
              Content="_Clear" Background="BlanchedAlmond" BorderBrush="Blue" ClickMode="Press"
              Command="{Binding Path=Clear}"></Button>
      <Button HorizontalAlignment="Left" VerticalAlignment="Center" Grid.Column="1"
              MinWidth="20" MinHeight="25" MaxHeight="45" Width="50" Padding="0" Margin="65,2,5,2"
              Content="_Undo" Background="BlanchedAlmond" BorderBrush="Blue" ClickMode="Press"
              Command="{Binding Path=Undo}"></Button>
      <Button HorizontalAlignment="Left" VerticalAlignment="Center" Grid.Column="1"
              MinWidth="20" MinHeight="25" MaxHeight="45" Width="50" Padding="0" Margin="120,2,5,2"
              Content="_Re-Do" Background="BlanchedAlmond" BorderBrush="Blue" ClickMode="Press"
              Command="{Binding Path=ReDo}"></Button>
      <TextBlock VerticalAlignment="Bottom" HorizontalAlignment="Right"
                 Margin="0,2,10,4" TextTrimming="WordEllipsis" Grid.Column="2"
                 FontFamily="Verdana" FontSize="16"
                 Name="NoficationArea" Text="{Binding Path=Message}">
      </TextBlock>
    </Grid>

    <Grid Grid.Row="2" Background="BlanchedAlmond">
      <controls:SudokuGrid x:Name="grid" Background="Cyan" HorizontalAlignment="Center" VerticalAlignment="Center">
      </controls:SudokuGrid>
    </Grid>

    <Grid Background="Lavender" Grid.Row="4">
      <Grid.ColumnDefinitions>
        <ColumnDefinition Width="140"></ColumnDefinition>
        <ColumnDefinition Width="205"></ColumnDefinition>
        <ColumnDefinition Width="*"></ColumnDefinition>
        <ColumnDefinition Width="90"></ColumnDefinition>
      </Grid.ColumnDefinitions>
      
      <CheckBox HorizontalAlignment="Left" VerticalAlignment="Center"
                Margin="10,0,0,0"
                Content="_Start Solving" IsChecked="{Binding Path=StartSolving}" />

      <CheckBox HorizontalAlignment="Left" VerticalAlignment="Center"
                Margin="10,0,0,0" Grid.Column="1"
                Content="Only _Puzzle" IsChecked="{Binding Path=OnlyPuzzle}" />
      <Button HorizontalAlignment="Left" VerticalAlignment="Center" Grid.Column="1"
              MinWidth="20" MinHeight="25" MaxHeight="45" Width="90" Padding="0" Margin="100,2,5,2"
              Content="E_xport" Background="BlanchedAlmond" BorderBrush="Blue" ClickMode="Press"
              Command="{Binding Path=Export}"></Button>
      <Button HorizontalAlignment="Right" VerticalAlignment="Center" Grid.Column="3"
              MinWidth="20" MinHeight="25" MaxHeight="45" Width="70" Padding="0" Margin="5,2,10,2"
              Content="_Exit" Background="BlanchedAlmond" BorderBrush="Blue" ClickMode="Press"
              Command="{Binding Path=Exit}"></Button>
    </Grid>
  </Grid>
</Window>